<template>
	<view class="container">

		<view class="user-section">
			<view class="bg-gradual-blue padding radius text-center shadow-blur">
				<view class="user-info-box">
					<view class="portrait-box">
						<image class="portrait" :src="userInfo.avatarUrl || '/static/missing-face.png'"></image>
					</view>
					<view class="info-box padding">
						<text class="text-lg">{{userInfo.nickName || '未登录'}}</text>
					</view>
				</view>
			</view>
		</view>
		<view class="history-section icon">
			<!-- <list-cell icon="icon-bianji" iconColor="#ee883b" title="建议反馈" border="" @eventClick="navTo('/pages/set/set')"></list-cell> -->
			<!-- <list-cell icon="icon-pinglun-copy" iconColor="#ee883b" title="联系客服" border=""> -->
				<!-- <button class="contact-btn" open-type="contact">a</button> -->
			<!-- </list-cell> -->
			
			
			<list-cell icon="icon-shezhi1" iconColor="#e07472" title="设置" border="" @eventClick="navTo('/pages/set/set')"></list-cell>
		</view>

	</view>
</template>
<script>
	import listCell from '@/components/mix-list-cell';
	import {
		mapState
	} from 'vuex';
	let startY = 0,
		moveY = 0,
		pageAtTop = true;
	export default {
		components: {
			listCell
		},
		data() {
			return {
				coverTransform: 'translateY(0px)',
				coverTransition: '0s',
				moving: false,
			}
		},
		computed: {
			...mapState(['hasLogin', 'userInfo'])
		},
		methods: {
			/**
			 * 统一跳转接口,拦截未登录路由
			 * navigator标签现在默认没有转场动画，所以用view
			 */
			navTo(url) {
				if (!this.hasLogin) {
					url = '/pages/public/wxlogin';
				}
				uni.navigateTo({
					url
				})
			},
		}
	}
</script>
<style lang='scss'>
	%section {
		display: flex;
		justify-content: space-around;
		align-content: center;
		background: #fff;
		border-radius: 10upx;
	}
	.contact-btn {
	  display: inline-block;
	  position: absolute;
	  width: 100%;
	  background: salmon;
	    opacity: 0;
	}

	.user-section {
		height: 380upx;
		position: relative;

		.bg {
			position: absolute;
			left: 0;
			top: 0;
			width: 100%;
			height: 100%;
			filter: blur(1px);
			opacity: .7;
		}
	}

	.user-info-box {
		height: 300upx;
		display: flex;
		align-items: center;
		position: relative;
		z-index: 1;

		.portrait {
			width: 130upx;
			height: 130upx;
			border: 5upx solid #fff;
			border-radius: 50%;
		}

		.username {
			font-size: $font-lg + 6upx;
			color: $font-color-dark;
			margin-left: 20upx;
		}
	}

	/* 菜单列表 */
	.history-section {
		padding: 30upx 0 0;
		margin-top: 20upx;
		background: #fff;
		border-radius: 10upx;

		.sec-header {
			display: flex;
			align-items: center;
			font-size: $font-base;
			color: $font-color-dark;
			line-height: 40upx;
			margin-left: 30upx;

			.yticon {
				font-size: 44upx;
				color: #5eba8f;
				margin-right: 16upx;
				line-height: 40upx;
			}
		}
	}
</style>
